var datavue;

$(document).ready(function() {
    console.log("页面加载完毕")
    getList(1);


});


function getList(pageNo) {
    console.log("获取数据")

    $.ajax({
        url:basePath + "/userincome/ajaxList",
        data:{"pageNo":pageNo},
        type: "POST",
        dataType:"json",
        success:function (data) {
            console.log(data)
            var vue = new Vue({
                el: '#qiu_vue',
                data: {
                    items:data.list,
                    curPageNo:data.curPageNo,
                    totalPages:data.totalPages,
                    totalItems:data.totalItems
                },
                methods:{
                    btnClick:function (index) {
                        console.log(index)
                        $.ajax({
                            url: basePath + "/userincome/ajaxList",
                            data: {"pageNo": index},
                            type: "POST",
                            dataType: "json",
                            success: function (result) {
                                console.log(result)
                                vue.$data.items = result.list;
                                vue.$data.curPageNo = result.curPageNo;
                                vue.$data.totalPages = result.totalPages;
                                vue.$data.totalItems = result.totalItems;
                            }
                        })
                    },
                    classRenderer:function (index) {
                        var $this = this;
                        var cur = $this.curPageNo
                        if(index == cur) {
                            return "active"
                        }
                        return ""
                    }
                },
                computed:{

                }
            })

            datavue = vue;
        }
    })
}

function getData(pageNo) {
    console.log("------------account:");
}

function seachByAccount() {
    console.log($("#topCondition").val())
    $.ajax({
        url: basePath + "/userincome/ajaxList",
        data: {"account": $("#topCondition").val()},
        type: "POST",
        dataType: "json",
        success: function (result) {
            console.log(result)
            datavue.$data.items = result.list;
            datavue.$data.curPageNo = result.curPageNo;
            datavue.$data.totalPages = result.totalPages;
            datavue.$data.totalItems = result.totalItems;
        }
    })
}

